package com.dexgdx.game.action;

import java.util.ArrayList;
import java.util.List;


public class ActionPack{
	
	List<IAction> actionList;

	public ActionPack() {
		super();
		this.actionList = new ArrayList<IAction>();
	}
	
	public ActionPack(IAction action) {
		super();
		this.actionList = new ArrayList<IAction>();
		actionList.add(action);
	}

	public void runNextStep(){
		if(actionList.size() > 0){
			actionList.get(0).runNextStep();
			if(actionList.get(0).isFinished()){
				actionList.remove(0);
			}
		}
	}

	public boolean isFinished() {
		return actionList.size() == 0;
	}
	
	public ActionPack addAction(IAction action){
		actionList.add(action);
		return this;
	}
	
}
